//
//  PersonView.m
//  FruitVIP
//
//  Created by 孙艳玲 on 15/7/14.
//  Copyright (c) 2015年 孙艳玲. All rights reserved.
//

#import "PersonView.h"

#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)

@implementation PersonView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self getUI];
    }
    return self;
}

- (void)getUI
{
    UILabel *moneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 10, SCREEN_WIDTH/5, 20)];
    moneyLabel.text = @"余额(元)";
    moneyLabel.font = [UIFont systemFontOfSize:15];
//    moneyLabel.backgroundColor = [UIColor whiteColor];
    moneyLabel.textColor = [UIColor colorWithRed:110.0 / 255.0 green:78.0 / 255.0 blue:71.0 / 255.0 alpha:1];
    moneyLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:moneyLabel];
    
    UIButton *payButton = [UIButton buttonWithType:UIButtonTypeCustom];
    payButton.frame = CGRectMake(SCREEN_WIDTH - SCREEN_WIDTH/4, moneyLabel.frame.origin.y, SCREEN_WIDTH/4, moneyLabel.frame.size.height);
    payButton.titleLabel.font = [UIFont systemFontOfSize:15];
    [payButton setTitle:@"消费记录" forState:UIControlStateNormal];
    [payButton setTitleColor:[UIColor colorWithRed:110.0 / 255.0 green:78.0 / 255.0 blue:71.0 / 255.0 alpha:1] forState:UIControlStateNormal];
    payButton.titleLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:payButton];
    
    UILabel *detailMoneyLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/3, moneyLabel.frame.origin.y + moneyLabel.frame.size.height + 50, SCREEN_WIDTH/3, SCREEN_WIDTH/8)];
    detailMoneyLabel.text = @"10000元";
    detailMoneyLabel.font = [UIFont systemFontOfSize:17];
    detailMoneyLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:detailMoneyLabel];
    
    UIButton *topButton = [UIButton buttonWithType:UIButtonTypeCustom];
    topButton.frame = CGRectMake(SCREEN_WIDTH/4, detailMoneyLabel.frame.origin.y + detailMoneyLabel.frame.size.height + 30, SCREEN_WIDTH/2, detailMoneyLabel.frame.size.height);
    topButton.backgroundColor =  [UIColor colorWithRed:255.0/255.0 green:205.0 / 255.0 blue:0 / 255.0 alpha:1];
    [topButton setTitleColor:[UIColor colorWithRed:110.0 / 255.0 green:78.0 / 255.0 blue:71.0 / 255.0 alpha:1] forState:UIControlStateNormal];
    [topButton setTitle:@"充值" forState:UIControlStateNormal];
    topButton.titleLabel.font = [UIFont systemFontOfSize:15];
    topButton.layer.cornerRadius = CGRectGetHeight([topButton bounds])/2;
    [self addSubview:topButton];
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
